/**
 * Copyright (c) 2011-2016, hubin (jobob@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.iwjw.ibatis.mapper;

import org.apache.ibatis.builder.MapperBuilderAssistant;
import org.apache.ibatis.session.Configuration;

/**
 * SQL注入
 */
public interface ISqlInjector {

    /**
     * 默认resultMap值
     */
    public static final String DEFAULT_RESULT_MAP = "BaseResultMap";

    /**
     * 条件语句
     */
    public static final String QUERY_ENTITY = "_$example";

    /**
     * 更新对象
     */
    public static final String ENTITY = "_$record";

    /**
     * 批量主键操作
     */
    public static final String PRIMARY_KEYS = "_$ids";

    /**
     * 主键操作
     */
    public static final String PRIMARY_KEY = "_$id";

    /**
     * 指定放回值操作
     */
    public static final String RETURN_FIELDS_KEY = "_$returnFields";

    /**
     * 是否从主库操作
     */
    public static final String MASTER_MARK="_$masterMark";

    /**
     * 分页参数
     */
    public static final String ROW_BOUNDS ="_$page";


    /**
     * SQL注入（需要自行判断是否重复注入）
     *
     * @param configuration
     * @param builderAssistant
     * @param mapperClass
     */
    void inject(Configuration configuration, MapperBuilderAssistant builderAssistant, Class<?> mapperClass);

    /**
     * resultMap注入（需要自行判断是否重复注入）
     *
     * @param configuration
     * @param builderAssistant
     * @param mapperClass
     */
    void injectResultMap(Configuration configuration, MapperBuilderAssistant builderAssistant, Class<?> mapperClass);


}
